package authorized

import (
	"github.com/xinliangnote/go-gin-api/internal/pkg/core"
	"github.com/xinliangnote/go-gin-api/internal/repository/mysql"
	"github.com/xinliangnote/go-gin-api/internal/repository/redis"
	"github.com/xinliangnote/go-gin-api/internal/services/customer/authorized"
	"go.uber.org/zap"
)

var _ Handler = (*handler)(nil)

type Handler interface {
	// Detail 获取单条任务详情
	// @Tags API.customer.auth
	// @Router  /api/customer/auth/sms/{phone_number} [get]
	SendVerifyCode() core.HandlerFunc

	// CheckVerifyCode 校验验证码
	// @Tags API.customer.auth
	// @Router  /api/customer/auth/sms [post]
	CheckVerifyCode() core.HandlerFunc
}

type handler struct {
	logger      *zap.Logger
	db mysql.Repo
	cache redis.Repo
	service authorized.ServiceInt
}



func New(logger *zap.Logger, db mysql.Repo, cache redis.Repo) Handler {
	return &handler{
		logger:      logger,
		db:	db,
		cache:       cache,
		service: authorized.New(db, cache),
	}
}

